package org.butterfly.springboot.watchdog;

import org.butterfly.watchdog.annotations.EnableWatchDog;
import org.butterfly.watchdog.task.TaskFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * function description
 *
 * @author drake
 * @since 2022/3/30
 */
@EnableWatchDog(firstDelay = 2000, period = 2000)
@Configuration
public class WatchDogConfig {
    @Bean
    public TaskFactory taskFactory() {
        TaskFactory factory = new TaskFactory();
        factory.addTask(new SampleTask());
        return factory;
    }
}
